import java.io.File;

import javax.swing.JFileChooser;

public class FlashCards {
	public static void main(String[] args) {
		java.util.Scanner s = new java.util.Scanner(System.in);
		java.io.PrintStream o = System.out;
		final JFileChooser fc = new JFileChooser();
		File file = null;
		while (file == null) {
			fc.showOpenDialog(null);
			file = fc.getSelectedFile();
		}
		Deck deck = new Deck(file);
		while (true) {
			o.print(deck.getCurrentText());
			s.nextLine();
			deck.flip();
			o.println(deck.getCurrentText());
			deck.next();
			s.nextLine();
		}
	}
}
